package blbetter.db;

import java.sql.SQLException;
import java.util.Vector;

public class BLCleanTest {

	public static void main(String[] args) throws SQLException {
		BLDataBaseSQL db = new BLDataBaseSQL();

		// String name = "SV Bayer 04 Leverkusen";
		//		
		// String sql = "SELECT \"teamId\" FROM \"Teams\" WHERE name = '" + name
		// + "' LIMIT 1";
		//		
		// ResultSet rs = db.executeQuery(sql);
		// rs.next();
		// int teamId = rs.getInt(1);
		// System.out.println(teamId);

		Vector<Spiel> spiele = db.getLetzteNSpieleByTeam(55, 1, db
				.getSaisonIdByJahr1(2009), 25);
		System.out.println(spiele);

		// 55->48
		// 56->39
		// 10->24
		int oid = 10;
		int nid = 24;

		String sql = "UPDATE \"Spiele\" SET \"heimId\" = " + nid
				+ " WHERE \"heimId\" = " + oid;

		db.execute(sql);

		sql = "UPDATE \"Spiele\" SET \"gastId\" = " + nid
				+ " WHERE \"gastId\" = " + oid;

		db.execute(sql);

	}

}
